package com.example.actearly_revised;

import android.os.Bundle;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.Typeface;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.TextView;

public class PreTracker extends Activity {

	TextView secondMessage;
	TextView firstMessage;
	View actionbarView;
	Button cont;
	Intent prev;
	int profile_number;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_pre_tracker);
		LinearLayout pageLayout=(LinearLayout)findViewById(R.id.PreTrackerLayout);
		//pageLayout.setBackgroundResource(R.drawable.background);

		//change font/color/text in action bar
		Typeface customFont = Typeface.createFromAsset(getAssets(), "fonts/futuram.ttf");
		getActionBar().setTitle("Act Early");
		
		prev = getIntent();
		profile_number = prev.getIntExtra("profile_number",1);

		//firstMessage = (TextView) findViewById(R.id.txtFirstMessage);
		secondMessage = (TextView) findViewById(R.id.txtSecondMessage);
		cont = (Button) findViewById(R.id.bttnContinue);
		TextView buttonText= (Button) findViewById(R.id.bttnContinue);

		secondMessage.setTypeface(customFont);
		// firstMessage.setTypeface(customFont);   
		buttonText.setTypeface(customFont);

		SQLogic conn = new SQLogic(PreTracker.this);
		User profile;

		conn.open();
		profile = conn.getUserData(profile_number);
		conn.close();

		// firstMessage.setText("Check the milestones " + profile.childname + " has reached at each age");

		secondMessage.setText("Answer the following questions about " + profile.childname + "\'s" + 
				" milestones. Talk with Dr. " + profile.doctor + " at every visit about the milestones " +
				profile.childname + " has reached and what to expect next.");

		cont.setOnClickListener(new View.OnClickListener() {

			public void onClick(View v) {
				finish();
				Intent intent = new Intent("com.example.actearly_revised.TabHomePage");
				intent.putExtra("profile_number", profile_number);
				startActivity(intent); 				
			}
		});

	}



	/*  @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_pre_tracker, menu);
        return true;
    }  */
}
